Skip to content

Comments

docs: use inject() and bootstrapApplication in dialog, snack-bar, and bottom-sheet docs#32839

Open
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:docs/popup-components-use-inject
Open

docs: use inject() and bootstrapApplication in dialog, snack-bar, and bottom-sheet docs#32839
yogeshwaran-c wants to merge 1 commit intoangular:mainfrom
yogeshwaran-c:docs/popup-components-use-inject

Conversation

@yogeshwaran-c
Copy link

What kind of change does this PR introduce?

Documentation update.

What is the current behavior?

The dialog, snack-bar, and bottom-sheet docs use outdated patterns:

  • Constructor injection with @Inject(TOKEN) for data injection tokens
  • Constructor injection for DialogRef / MatDialogRef
  • @NgModule provider blocks for default options
  • Relative import paths like '../dialog' instead of package paths

Relates to #32709

What is the new behavior?

  • Replace constructor injection with inject() function
  • Replace @Inject(TOKEN) with inject<Type>(TOKEN)
  • Replace @NgModule provider blocks with bootstrapApplication
  • Fix import paths to use proper package paths (@angular/material/dialog,
    @angular/material/snack-bar, @angular/material/bottom-sheet,
    @angular/cdk/dialog)
  • Update prose from "root module" to "app config"

Files changed

File Changes
src/cdk/dialog/dialog.md DialogRef constructor -> inject(), @Inject(DIALOG_DATA) -> inject(), @NgModule -> bootstrapApplication
src/material/dialog/dialog.md MatDialogRef constructor -> inject(), @Inject(MAT_DIALOG_DATA) -> inject(), @NgModule -> bootstrapApplication, fix import path
src/material/snack-bar/snack-bar.md @Inject(MAT_SNACK_BAR_DATA) -> inject(), @NgModule -> bootstrapApplication, fix import path
src/material/bottom-sheet/bottom-sheet.md @Inject(MAT_BOTTOM_SHEET_DATA) -> inject(), @NgModule -> bootstrapApplication, fix import path

@pullapprove pullapprove bot requested review from crisbeto and tjshiu February 23, 2026 21:18
@angular-robot angular-robot bot added area: docs Related to the documentation labels Feb 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Related to the documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant